//
//  CJPrePlayPageVIewModel.m
//  CoJellyCartoon
//
//  Created by dllo on 16/4/5.
//  Copyright © 2016年 CJG. All rights reserved.
//

#import "CJPrePlayPageVIewModel.h"
#import "CJRelatesModel.h"

@interface CJPrePlayPageVIewModel ()
@property (nonatomic, strong) NSMutableArray *relatesArray;
@end
@implementation CJPrePlayPageVIewModel

- (instancetype)initWithDataSource : (NSDictionary *)dataSource
{
    self = [super init];
    
    [self setValuesForKeysWithDictionary:dataSource];
    self.relatesArray = [NSMutableArray arrayWithCapacity:0];
    if (self) {
        
        
        for (NSDictionary *dic in self.relates) {
            CJRelatesModel *model = [[CJRelatesModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [self.relatesArray addObject:model];
            
        }
        
        self.relates = [NSArray arrayWithArray:self.relatesArray];
    }
    
    return self;
}
@end
